@echo off

call makeConfig.bat

set zkserviePath=%~dp0zookeeper.xml

(echo ^<?xml version="1.0" encoding="UTF-8" ?^>) >%zkserviePath%
(echo ^<service^>) >>%zkserviePath%
(echo ^<id^>zookeeper^</id^>) >>%zkserviePath%
(echo ^<name^>zookeeper^</name^>) >>%zkserviePath%
(echo ^<description^>zookeeper^</description^>) >>%zkserviePath%
(echo ^<executable^>%~dp0startZK.bat^</executable^>) >>%zkserviePath%
(echo ^<logpath^>%~dp0serviceLogs\^</logpath^>) >>%zkserviePath%
(echo ^<logmode^>roll^</logmode^>) >>%zkserviePath%
(echo ^<depend^>^</depend^>) >>%zkserviePath%
(echo ^<startargument^>^</startargument^>) >>%zkserviePath%
(echo ^<stopargument^>exit^</stopargument^>) >>%zkserviePath%
(echo ^</service^>) >>%zkserviePath%

zookeeper.exe install
echo install zookeeper success
pause